Public Class CLookupData
    Inherits BOBase

    Protected m_State As LookupDataDS
    Protected m_DA As LookupDatas

#Region "   Inherits Implementation"
    Sub New()
        m_State = New LookupDataDS
    End Sub

    Public Overrides ReadOnly Property DA() As DABase
        Get
            If m_DA Is Nothing Then
                m_DA = New LookupDatas
            End If

            Return m_DA
        End Get
    End Property

    Public Overrides Property ObjectState() As DataSet
        Get
            Return m_State
        End Get
        Set(ByVal Value As DataSet)
            Try
                m_State = CType(Value, LookupDataDS)
            Catch ex As InvalidCastException
                Throw New ApplicationException("Invalid LOOK_UP_DATA Dataset!", ex)
            End Try
        End Set
    End Property

    Public Overrides Sub Init()
        m_State.Tables(0).Clear()
        Dim dr As LookupDataDS.LOOK_UP_DATARow = m_State.LOOK_UP_DATA.NewLOOK_UP_DATARow
        With dr
            .LK_ID_FK = Nothing
            .VALUE1 = String.Empty
            .SetVALUE2Null()
            .SetVALUE3Null()
        End With
        m_State.LOOK_UP_DATA.Rows.Add(dr)
    End Sub
#End Region

#Region "   Data Properties"
    Protected ReadOnly Property DataRow() As LookupDataDS.LOOK_UP_DATARow
        Get
            Return CType(Me.Row, LookupDataDS.LOOK_UP_DATARow)
        End Get
    End Property

    Public ReadOnly Property ID() As System.Int32
        Get
            Return Me.DataRow.LKD_ID_PK
        End Get
    End Property

    Public Property LookupID() As System.Int32
        Get
            Return Me.DataRow.LK_ID_FK
        End Get
        Set(ByVal Value As System.Int32)
            Me.DataRow.LK_ID_FK = Value
        End Set
    End Property

    Public Property Value1() As System.String
        Get
            Return Me.DataRow.VALUE1
        End Get
        Set(ByVal Value As System.String)
            Me.DataRow.VALUE1 = Value
        End Set
    End Property

    Public Property Value2() As System.String
        Get
            If Me.DataRow.IsVALUE2Null Then
                Return Nothing
            Else
                Return Me.DataRow.VALUE2
            End If
        End Get
        Set(ByVal Value As System.String)
            If Value = Nothing Then
                Me.DataRow.SetVALUE2Null()
            Else
                Me.DataRow.VALUE2 = Value
            End If
        End Set
    End Property

    Public Property Value3() As System.String
        Get
            If Me.DataRow.IsVALUE3Null Then
                Return Nothing
            Else
                Return Me.DataRow.VALUE3
            End If
        End Get
        Set(ByVal Value As System.String)
            If Value = Nothing Then
                Me.DataRow.SetVALUE3Null()
            Else
                Me.DataRow.VALUE3 = Value
            End If
        End Set
    End Property
#End Region

End Class
